/*
 * Famon (http://code.google.com/p/famon/)
 * Copyright (c) 2010 Carl Crous.
 *
 * This file is part of Famon.
 *
 * Famon is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Famon is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with Famon.  If not, see <http://www.gnu.org/licenses/>.
 */

package za.org.foobar.famon.dto;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * The data carier for a failure
 */
public class CFailure implements Serializable {
    // The user which was affected by the failure
    private String user;
    // The type of the failure
    private String failureType;
    // The failure's actual message
    private String message;
    // The date and time the failure occurred
    private Date date;

    private List<CThreadInformation> threads;

    public CFailure() {
        threads = new ArrayList<CThreadInformation>();
    }

    public CFailure(String user, String failureType, String message, Date date, List<CThreadInformation> threads) {
        this.user = user;
        this.failureType = failureType;
        this.message = message;
        this.date = date;
        this.threads = threads;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getMessage() {
        return message;
    }

    public String getFailureType() {
        return failureType;
    }

    public void setFailureType(String failureType) {
        this.failureType = failureType;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public List<CThreadInformation> getThreads() {
        return threads;
    }

    public void setThreads(List<CThreadInformation> threads) {
        this.threads = threads;
    }

    public void addThread(CThreadInformation thread) {
        threads.add(thread);
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }
}
